package ployParameter;

public class Main {
    public static void main(String[] args) {
        Worker w1 = new Worker("李华", 8000);
        Manager m1 = new Manager("马可", 10000, 5000);
        Main main = new Main();
        main.showAnnual(w1);
        main.showAnnual(m1);
    }

    public void showAnnual(Employee e) {
        System.out.println(e.getName() + "\t" + e.getAnnual());
        if(e instanceof Manager) {
            ((Manager) e).manage();
        }
        else if(e instanceof Worker) {
            ((Worker) e).work();
        }
    }
}
